<template>

	<view class="container">
		<view
			style="margin-top: 10px;margin-left: 10px;margin-right: 10px;height: 67px;padding-left: 10px;border-radius: 5px;margin-bottom: 0px;">
			<view style="float: left;padding-top: 10px;">
				<image src="../../static/image_gooli/logo2.png" style="height: 51px;width:400px;"></image>
			</view>



			<view style="float: left;text-align: center;padding-top: 35px;color: #204301;font-size: 12px;">
				<!-- Copyright 技术支持：亦卓科技 -->
			</view>
			<view style="float: left;font-size: 14px;color: grey;padding-top: 10px;margin-left:  calc(100vw - 850px);">
				<button type="default" @click="getPruductLanguage(102)"
					style="background-color: #6db650;line-height: 35px;float: left;margin-left: 10px;color:#fff;font-size: 14px">1</button>

				<button type="default" @click="getPruductLanguage(101)"
					style="background-color: #6db650;line-height: 35px;float: left;margin-left: 10px;color:#fff;font-size: 14px">2</button>

				<button type="default" @click="getPruductLanguage(100)"
					style="background-color: #6db650;line-height: 35px;float: left;margin-left: 10px;color:#fff;font-size: 14px">3</button>
				<view style="line-height: 40px;padding-left: 30px;color: #ffffff;float: left;">
					{{this.lanuage.workingState}}：{{workModemsg}}
				</view>
			</view>
		</view>
		<view style="clear: both;"></view>

		<view style="float: left;width: 325px;margin-top:17px;">

			<view style="color: #fff;text-align: right;margin-right: 35px;">
				<label>{{this.lanuage.totalWater}}：{{totalFlow}}L</label>
				<image src="../../static/imageV7/refresh.png" style="width: 16px;height: 16px;margin-left:15px;"
					@click="setValueCurrentByFlowClear(23)">
				</image>
			</view>

			<view style="margin-top: 5px;">


				<view style="float: left;">
					<image src="../../static/imageV7/dianji.png"
						style="height: 120px;width:150px;vertical-align: middle;margin-left: 30px;">
					</image>
				</view>

				<view style="float: left; margin-left: 20px;">
					<!-- <view style="color: #fff;margin-top: 10px;">
						
						<image src="../../static/imageV7/refresh.png" style="width: 16px;height: 16px;margin-left: 5px;"
							@click="setValueCurrentByFlowClear(23)">
						</image>
					</view> -->
					<view style="text-align:center;margin-top: 20px;margin-left: 30px;">
						<image src="../../static/image/watertotal.png" style="height: 90px;width:60px;"></image>
					</view>

				</view>
				<view style="clear: both;"></view>
				<view style="margin-top: 0px;margin-left: 20px;margin-bottom: 10px;">

				</view>
			</view>
			<view style="clear: both;"></view>

			<view class="viewgrid"
				style="background-color:#65b316;margin-top: 10px;padding: 15px;border-radius: 5px;margin-left: 10px;">
				<view
					style="border-radius: 5px;line-height: 30px;background-color: #499c0e;font-weight: bold;color: #fff;text-align: center;font-size: 14px">
					{{this.lanuage.duration}}
				</view>

				<view style="text-align: center;margin-top: 20px;">
					<table class="tableList jiaoshuiclass" style="font-size: 14px;margin: 0 auto;">
						<tr>

							<td><input type="number" value="20" style="width: 80px;" id="wateringSecond"
									v-model="wateringSecond" @input="inputNumberChange" /></td>
							<td>{{this.lanuage.second}}</td>
							<td><button class="butset2"
									@click="setLinkageConditionValue(3,wateringSecond)">{{this.lanuage.save}}</button>
							</td>

						</tr>
					</table>
				</view>
			</view>

			<view class="" style="margin-top: 10px;margin-left: 10px;">
				<view class="" style="background-color:#65b316;height: 363px; padding: 10px;border-radius: 10px;">

					<view class="viewgrid"
						style="background-color:#65b316;margin-top: 10px;padding: 5px;border-radius: 5px;">
						<view style="height: 120px;">

							<view style="width: 230px;margin: 0 auto;">
								<button class="butset3" style="margin-top: 20px;"
									@click="showlinkageset()">{{this.lanuage.conditionMode}}</button>
							</view>
							<view style="width: 230px;margin: 0 auto;">
								<button class="butset3" style="margin-top: 20px;"
									@click="showtaskset()">{{this.lanuage.autoTasktitle}}</button>
							</view>
						</view>
					</view>


				</view>
			</view>
		</view>
		<view style="float: left;font-size: 14px;width: 950px;">
			<view>
				<view style="" class="viewshuifeitop" style="width: 130px;">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/ec2.png" style="height: 25px;width:20px;"></image>
					</view>
					<view style="float: left;width: 100px">
						<view style="font-weight: bold;">EC</view>
						<view>{{ec}} us/cm </view>
					</view>
					<view style="clear: both;"></view>
				</view>
				<view style="width: 120px;" class="viewshuifeitop">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/ph2.png" style="height: 25px;width:25px;"></image>
					</view>
					<view style="float: left;width: 90px">
						<view style="font-weight: bold;">PH</view>
						<view>{{ph}} ph</view>
					</view>
					<view style="clear: both;"></view>
				</view>
				<view style="" class="viewshuifeitop" style="width: 135px;">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/watertemp.png" style="height:25px;width:25px;"></image>
					</view>
					<view style="float: left;width: 105px">
						<view style="font-weight: bold;">{{this.lanuage.watertemp}}</view>
						<view>{{watertempValue}} ℃ </view>
					</view>
					<view style="clear: both;"></view>
				</view>
				<view style="width: 165px;" class="viewshuifeitop">
					<view class="viewshuifeitopImg">
						<image src="../../static/image/light2.png" style="height: 25px;width:25px;"></image>
					</view>
					<view style="float: left;width: 125px">
						<view style="font-weight: bold;">{{this.lanuage.LightIntensity}}</view>
						<view>{{light}} lux</view>
					</view>
					<view style="clear: both;"></view>
				</view>
				<view style="width: 135px;" class="viewshuifeitop">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/temp2.png" style="height: 25px;width:20px;"></image>
					</view>
					<view style="float: left;width: 110px">
						<view style="font-weight: bold;">{{this.lanuage.Temperature}}</view>
						<view>{{ temperature }} ℃</view>
					</view>
					<view style="clear: both;"></view>
				</view>
				<view style="width: 140px;" class="viewshuifeitop">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/hum2.png" style="height: 25px;width:20px;"></image>
					</view>
					<view style="float: left;width: 110px">
						<view style="font-weight: bold;">{{this.lanuage.Humidity}}</view>
						<view>{{humidity}} %RH</view>
					</view>
					<view style="clear: both;"></view>
				</view>

				<view style="clear: both;"></view>
			</view>
			<view>
				<view style="" class="viewshuifeitop" style="width: 110px;">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/PM10.png" style="height: 20px;width:20px;"></image>
					</view>
					<view style="float: left;width: 85px">
						<view style="font-weight: bold;">PM10</view>
						<view>{{pm10}} μg/m³ </view>
					</view>
					<view style="clear: both;"></view>
				</view>
				<view style="width: 110px;" class="viewshuifeitop">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/PM2.5.png" style="height: 20px;width:20px;"></image>
					</view>
					<view style="float: left;width: 85px">
						<view style="font-weight: bold;">PM2.5</view>
						<view>{{pm25}} μg/m³</view>
					</view>
					<view style="clear: both;"></view>
				</view>
				<view style="width: 130px;" class="viewshuifeitop">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/tvoc.png" style="height: 20px;width:20px;"></image>
					</view>
					<view style="float: left;width: 100px">
						<view style="font-weight: bold;">TVOC</view>
						<view>{{tvoc}} ppb</view>
					</view>
					<view style="clear: both;"></view>
				</view>

				<view style="" class="viewshuifeitop" style="width: 140px;">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/formaldehyde.png" style="height:20px;width:20px;"></image>
					</view>
					<view style="float: left;width: 110px;">
						<view style="font-weight: bold;">{{this.lanuage.Formaldehyde}}</view>
						<view>{{formaldehyde}} ppm</view>
					</view>
					<view style="clear: both;"></view>
				</view>

				<view style="width: 95px;" class="viewshuifeitop">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/noise.png" style="height: 20px;width:20px;"></image>
					</view>
					<view style="float: left;width: 70px">
						<view style="font-weight: bold;">{{this.lanuage.Noise}}</view>
						<view>{{ noise }} dB</view>
					</view>
					<view style="clear: both;"></view>
				</view>
				<view style="width: 110px;" class="viewshuifeitop">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/o3.png" style="height: 20px;width:20px;"></image>
					</view>
					<view style="float: left;width: 85px">
						<view style="font-weight: bold;">{{this.lanuage.Ozone}}</view>
						<view>{{ozone}} ppm</view>
					</view>
					<view style="clear: both;"></view>
				</view>
				<view style="width: 115px;" class="viewshuifeitop">
					<view class="viewshuifeitopImg">
						<image src="../../static/imageV7/co22.png" style="height:20px;width:20px;"></image>
					</view>
					<view style="float: left;width: 90px">
						<view style="font-weight: bold;">{{this.lanuage.co2}}</view>
						<view>{{co2}} ppm</view>
					</view>
					<view style="clear: both;"></view>
				</view>
				<view style="clear: both;"></view>
			</view>
			<view style="clear: both;"></view>
			<view>
				<view style="float: left;min-width: 300px;margin-left: 10px;">
					<view style="text-align: center;">
						<image src="../../static/imageV7/yinyangye.png"
							style="height: 150px;width:332px;margin-top: 20px;">
						</image>
					</view>
					<view class="viewgrid"
						style="background-color:#65b316;margin-top:5px;padding: 5px;border-radius: 5px;">
						<view>
							<view
								style="border-radius: 5px;line-height: 30px;background-color: #499c0e;padding-left:20px;font-weight: bold;color: #fff;width:350px;float: left;margin-right:10px;font-size: 14px">
								{{this.lanuage.autoMode}}
							</view>

							<view
								style="border-radius: 5px;line-height: 30px;background-color: #499c0e;font-weight: bold;color: #fff;width: 150px;float: left;text-align: center;font-size: 14px">
								{{this.lanuage.manualMode}}
							</view>
						</view>

						<view class="user-insert-line"></view>
						<view>
							<table class="tableListset tablewater" style="margin-bottom:0px;width: 550px; ">
								<tr>
									<td>
										<!-- 	<image src="../../static/image/管道.png"
											style="height: 20px;width:20px;vertical-align: middle;margin-right: 5px;">
										</image> -->
										{{this.lanuage.pipeline1}}
									</td>
									<td>
										<input type="number" id="currentFlow1" value="0.2" @input="inputNumberChange"
											style="float: left;" v-model="currentFlow1" />L
									</td>

									<td> <button class="butset2"
											@click="setLinkageConditionValue(5,currentFlow1)">{{this.lanuage.save}}</button>
									</td>
									<td>

										<table>
											<tr>
												<td>{{this.lanuage.total}}:
												</td>
												<td> {{total1Value}}L
												</td>
												<td>
													<image src="../../static/imageV7/refresh.png"
														style="width: 16px;height: 16px;margin-left: 5px;"
														@click="setValueCurrentByFlowClear(17)">
													</image>
												</td>
											</tr>
										</table>
									</td>
									<td>
										<button class="butset3" style=""
											:style="[{color:(yingyang1Status=='open'?selectColor:noselectColor)}]"
											@click="sendDeviceControl(26,'open')">{{this.lanuage.open}}</button>
									</td>
									<td> <button class="butset3" style=""
											:style="[{color:(yingyang1Status=='close'?selectColor:noselectColor)}]"
											@click="sendDeviceControl(26,'close')">{{this.lanuage.close}}</button>
									</td>
								</tr>
								<tr>
									<td>
										<!-- <image src="../../static/image/管道.png"
											style="height: 20px;width:20px;vertical-align: middle;margin-right: 5px;">
										</image> -->
										{{this.lanuage.pipeline2}}
									</td>
									<td><input type="number" id="currentFlow2" value="0.2" @input="inputNumberChange"
											style="float: left;" v-model="currentFlow2" />L

									</td>

									<td> <button class="butset2"
											@click="setLinkageConditionValue(7,currentFlow2)">{{this.lanuage.save}}</button>
									</td>
									<td>
										<table>
											<tr>
												<td>{{this.lanuage.total}}:
												</td>
												<td> {{total2Value}}L
												</td>
												<td>
													<image src="../../static/imageV7/refresh.png"
														style="width: 16px;height: 16px;margin-left: 5px;"
														@click="setValueCurrentByFlowClear(18)">
													</image>
												</td>
											</tr>
										</table>
									</td>
									<td>
										<button class="butset3" style=""
											:style="[{color:(yingyang2Status=='open'?selectColor:noselectColor)}]"
											@click="sendDeviceControl(8,'open')">{{this.lanuage.open}}</button>
									</td>

									<td> <button class="butset3" style=""
											:style="[{color:(yingyang2Status=='close'?selectColor:noselectColor)}]"
											@click="sendDeviceControl(8,'close')">{{this.lanuage.close}}</button>
									</td>
								</tr>
								<tr>
									<td>
										<!-- <image src="../../static/image/管道.png"
											style="height: 20px;width:20px;vertical-align: middle;margin-right: 5px;">
										</image> -->
										{{this.lanuage.pipeline3}}
									</td>
									<td><input type="number" id="currentFlow3" value="0.2" @input="inputNumberChange"
											style="float: left;" v-model="currentFlow3" />L
									</td>
									<td> <button class="butset2"
											@click="setLinkageConditionValue(9,currentFlow3)">{{this.lanuage.save}}</button>
									</td>
									<td>
										<table>
											<tr>
												<td>{{this.lanuage.total}}:
												</td>
												<td> {{total3Value}}L
												</td>
												<td>
													<image src="../../static/imageV7/refresh.png"
														style="width: 16px;height: 16px;margin-left: 5px;"
														@click="setValueCurrentByFlowClear(19)">
													</image>
												</td>
											</tr>
										</table>
									</td>
									<td>
										<button class="butset3" style=""
											:style="[{color:(yingyang3Status=='open'?selectColor:noselectColor)}]"
											@click="sendDeviceControl(13,'open')">{{this.lanuage.open}}</button>
									</td>

									<td> <button class="butset3" style=""
											:style="[{color:(yingyang3Status=='close'?selectColor:noselectColor)}]"
											@click="sendDeviceControl(13,'close')">{{this.lanuage.close}}</button>
									</td>
								</tr>

								<tr>
									<td>
										{{this.lanuage.pipeline4}}
									</td>
									<td><input type="number" id="currentFlow4" value="0.2" @input="inputNumberChange"
											style="float: left;" v-model="currentFlow4" />L
									</td>
									<td> <button class="butset2"
											@click="setLinkageConditionValue(11,currentFlow4)">{{this.lanuage.save}}</button>
									</td>
									<td>
										<table>
											<tr>
												<td>{{this.lanuage.total}}:
												</td>
												<td> {{total4Value}}L
												</td>
												<td>
													<image src="../../static/imageV7/refresh.png"
														style="width: 16px;height: 16px;margin-left: 5px;"
														@click="setValueCurrentByFlowClear(20)">
													</image>
												</td>
											</tr>
										</table>
									</td>
									<td>
										<button class="butset3" style=""
											:style="[{color:(yingyang4Status=='open'?selectColor:noselectColor)}]"
											@click="sendDeviceControl(12,'open')">{{this.lanuage.open}}</button>
									</td>

									<td> <button class="butset3" style=""
											:style="[{color:(yingyang4Status=='close'?selectColor:noselectColor)}]"
											@click="sendDeviceControl(12,'close')">{{this.lanuage.close}}</button>
									</td>
								</tr>
								<tr>
									<td>

									</td>
									<td>
									</td>
									<td>
									</td>
									<td>{{this.lanuage.agitatormotor}}
									</td>
									<td>
										<button class="butset3" style=""
											:style="[{color:(jiaobangjiStatus=='open'?selectColor:noselectColor)}]"
											@click="sendDeviceControl(31,'open')">{{this.lanuage.open}}</button>
									</td>

									<td> <button class="butset3" style=""
											:style="[{color:(jiaobangjiStatus=='close'?selectColor:noselectColor)}]"
											@click="sendDeviceControl(31,'close')">{{this.lanuage.close}}</button>
									</td>
								</tr>


							</table>


						</view>
					</view>


					<view class="viewgrid"
						style="background-color:#65b316;margin-top: 10px;padding: 5px;border-radius: 5px;">

						<view>

							<view
								style="border-radius: 5px;line-height: 30px;background-color: #499c0e;padding-left:20px;font-weight: bold;color: #fff;width: 95%;font-size: 14px">
								{{this.lanuage.alarm}}
							</view>
							<view>
								<table style="width: 460px;height: 57px;">
									<tr>
										<td style="width: 120px;">
											<button class="butset3" style="font-size: 14px;"
												@click="showWarnModal">{{this.lanuage.configuration}}</button>

										</td>
										<td style="color:greenyellow;font-size: 14px;">
											<image src="../../static/imageV7/jingbao.png"
												style="height: 18px;width: 18px"></image>
											{{warnmsg}}
										</td>
									</tr>
								</table>


								<view>

								</view>
							</view>

						</view>
					</view>
				</view>

				<view></view>
			</view>


			<view style="float: left;margin-left: 10px;width: 365px;">

				<view>
					<view style="text-align: center;padding-top: 0px;float: left;width: 60%;">

						<view style="margin-top:5px;">
							<!-- 	<image src="../../static/imageV7/chuangdong.png" style="height: 90px;width:110px;">
							</image> -->
						</view>
					</view>

				</view>
				<view style="clear: both;"></view>

				<view class="viewgrid"
					style="background-color:#65b316;margin-top: 10px;padding: 5px;border-radius: 5px;">
					<view style="background-color:#65b316;border-radius: 5px;padding: 10px;margin-top: 0px;">
						<view
							style="border-radius: 5px;line-height: 30px;background-color: #499c0e;font-weight: bold;color: #fff;width:95%;text-align: center;padding-left: 20px;font-size: 14px;">
							{{this.lanuage.manualMode}}
						</view>
						<table class="tablemanual" style="margin: 0 auto;margin-top: 10px;width: 100%;">
							<tr>
								<td style="text-align: center;">{{this.lanuage.motor}}</td>

								<td>
									<button class="butsetshoudong" style="float: left;"
										:style="[{color:(chuangdongStatus=='open'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(30,'open')">{{this.lanuage.open}}</button>
									<button class="butsetshoudong" style="margin-left:20px;float: left;"
										:style="[{color:(chuangdongStatus=='close'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(30,'close')">{{this.lanuage.close}}</button>
								</td>
							</tr>
							<tr>

								<td style="text-align: center;">{{this.lanuage.sb1title}}</td>

								<td style="">
									<button class="butsetshoudong" style="float: left;"
										:style="[{color:(sb1status=='open'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(15,'open')">{{this.lanuage.open}}</button>
									<button class="butsetshoudong" style="float: left;margin-left: 20px;"
										:style="[{color:(sb1status=='close'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(15,'close')">{{this.lanuage.close}}</button>
								</td>
							</tr>

							<tr>
								<td style="text-align: center;">{{this.lanuage.sb2title}}</td>

								<td>
									<button class="butsetshoudong" style="float: left;"
										:style="[{color:(sb2status=='open'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(11,'open')">{{this.lanuage.open}}</button>
									<button class="butsetshoudong" style="float: left;margin-left: 20px;"
										:style="[{color:(sb2status=='close'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(11,'close')">{{this.lanuage.close}}</button>
								</td>
							</tr>

							<tr>
								<td style="text-align: center;">{{this.lanuage.dg1title}}</td>

								<td>
									<button class="butsetshoudong" style="float: left;"
										:style="[{color:(dg1status=='open'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(7,'open')">{{this.lanuage.open}}</button>
									<button class="butsetshoudong" style="float: left;margin-left: 20px;"
										:style="[{color:(dg1status=='close'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(7,'close')">{{this.lanuage.close}}</button>
								</td>
							</tr>
							<tr>
								<td style="text-align: center;">{{this.lanuage.dg2title}}</td>

								<td>
									<button class="butsetshoudong" style="float: left;"
										:style="[{color:(dg2status=='open'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(53,'open')">{{this.lanuage.open}}</button>
									<button class="butsetshoudong" style="float: left;margin-left: 20px;"
										:style="[{color:(dg2status=='close'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(53,'close')">{{this.lanuage.close}}</button>
								</td>
							</tr>
							<tr>
								<td style="text-align: center;">{{this.lanuage.dg3title}}</td>

								<td>
									<button class="butsetshoudong" style="float: left;"
										:style="[{color:(dg3status=='open'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(54,'open')">{{this.lanuage.open}}</button>
									<button class="butsetshoudong" style="float: left;margin-left: 20px;"
										:style="[{color:(dg3status=='close'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(54,'close')">{{this.lanuage.close}}</button>
								</td>
							</tr>
							<tr>
								<td style="text-align: center;">{{this.lanuage.faucet}}</td>

								<td>
									<button class="butsetshoudong" style="float: left;"
										:style="[{color:(jiaoshuiStatus=='open'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(16,'open')">{{this.lanuage.open}}</button>
									<button class="butsetshoudong" style="float: left;margin-left: 20px;"
										:style="[{color:(jiaoshuiStatus=='close'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(16,'close')">{{this.lanuage.close}}</button>
								</td>
							</tr>
							<tr>
								<td style="text-align: center;">{{this.lanuage.co2}}</td>

								<td>
									<button class="butsetshoudong" style="float: left;"
										:style="[{color:(eryanghuatanStatus=='open'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(24,'open')">{{this.lanuage.open}}</button>
									<button class="butsetshoudong" style="float: left;margin-left: 20px;"
										:style="[{color:(eryanghuatanStatus=='close'?selectColor:noselectColor)}]"
										@click="sendDeviceControl(24,'close')">{{this.lanuage.close}}</button>
								</td>
							</tr>
							<tr>
								<td style="text-align: center;">{{this.lanuage.airconditioner}}</td>

								<td>
									<button class="butsetshoudong" style="float: left;"
										:style="[{color:(kongtiaoStatus=='hot'?selectColor:noselectColor)}]"
										@click="sendHeat()">{{this.lanuage.heating}}</button>
									<button class="butsetshoudong" style="float: left; margin-left: 20px;"
										:style="[{color:(kongtiaoStatus=='cold'?selectColor:noselectColor)}]"
										@click="sendCold()">{{this.lanuage.refrigeration}}</button>

								</td>
							</tr>
							<tr>
								<td style="text-align: center;"></td>

								<td>

									<button class="butsetshoudong" style="float: left;"
										:style="[{color:(kongtiaoStatus=='close'?selectColor:noselectColor)}]"
										@click="sendAirconditionClose()">{{this.lanuage.close}}</button>
								</td>
							</tr>
						</table>

						<view style="clear: both;"></view>

					</view>

					<view class="user-insert-line"></view>
					<view>


					</view>





				</view>

			</view>


		</view>


	</view>

</template>

<script>
	//	import modalwarn from '@/components/modalwarn.vue';

	//const toast = uni.requireNativePlugin('Ba-Toast')


	export default {
		components: {
			//modalwarn
		},
		data() {
			return {
				show: false,
				warnmsg: '',
				temperature: 0,
				humidity: 0,
				co2: 0,
				ec: 0,
				ph: 0,
				light: 0,
				pm10: 0,
				pm25: 0,
				formaldehyde: 0,
				tvoc: 0,
				noise: 0,
				ozone: 0,


				//-------
				totalFlow: 0,
				getRelayListData: [],
				wateringSecond: 0,
				startmin: 0,
				stopMin: 0,
				lightlow: 0,
				lighthigh: 0,
				co2low: 0,
				co2high: 0,
				//temperatureLow: 0,
				currentFlow1: 0,
				currentFlow2: 0,
				currentFlow3: 0,
				currentFlow4: 0,
				currentFlow5: 0,
				currentFlow6: 0,
				autoRun: 0,
				isNormalNetwork: true,
				workModemsg: "",
				total1Value: 0,
				total2Value: 0,
				total3Value: 0,
				total4Value: 0,
				total5Value: 0,
				total6Value: 0,
				startTimeInterval: '',
				startTimeIntervalNextSecondstr: '',
				startTimeIntervalNextSecond: 0,
				startTimeIntervalNextSecondreset: 0,
				setEC: 0,
				setPH: 0,
				temperatureLowDown: 0,
				temperatureLowUp: 0,
				watertempValue: 0,
				lanuage: {
					open: '',
					close: '',
					save: '',
					pipeline: '',
					WaterPumpOff: '',
					WaterPumpOn: '',
					totalWater: '',
					startAutoMode: '',
					stopAutoMode: '',
					second: '',
					total: '',
					duration: '',
					workingState: '',
					Runing: '',
					GatewayOffline: '',
					minute: '',
					autoMode: '',
					manualMode: '',
					conditionMode: '',
					ValueLowerThan: '',
					LightLowerThan: '',
					Co2lowerThan: '',
					openLight: '',
					openCo2: '',
					light: '',
					co2: '',
					stoptime: '',
					runtime: '',
					lastruntime: '',
					Humidity: '',
					Temperature: '',
					AutoRunMode: '',
					ManualRunMode: '',
					OperationSuccessful: '',
					OperationFaild: '',
					IsDoing: '',
					NextRunTime: '',
					motor: '',
					temperatureLow: '',
					heating: '',
					agitatormotor: '',
					watertemp: '',
					airconditioner: '',
					heating: '',
					refrigeration: '',
					configuration: '',
					alarm: '',
					tsconfirm: '',
					tscancel: '',
					tscontent: '',
					pipeline1: '',
					pipeline2: '',
					pipeline3: '',
					pipeline4: ''
				},
				LinkageConditionValue: '',
				PlainItemValue: '',
				PruductStateValue: '',
				ValueCurrentByProduct: '',
				ecisCheck: true,
				phisCheck: true,
				lightisCheck: true,
				co2isCheck: true,
				//设备状态

				selectColor: '#e4e64e',
				noselectColor: '#fff',
				shuibengStatus: '',
				jiaoshuiStatus: '',
				yingyang1Status: '',
				yingyang2Status: '',
				yingyang3Status: '',
				yingyang4Status:'',
				jiaobangjiStatus: '',
				chuangdongStatus: '',
				dengguangStatus: '',
				eryanghuatanStatus: '',
				kongtiaoStatus: '',
				sb1status: '',
				sb2status: '',
				dg1status: '',
				dg2status: '',
				dg3status: '',
			}
		},
		onReady() {
			setInterval(() => {
				this.getValueCurrentByProduct();
				this.getProductGateWayIsOnlineByCache();
				this.getTimeInterval();
				this.getProductWarn();
			}, 5000);
			setInterval(() => {
				this.getSecond();
			}, 1000);
			setInterval(() => {
				this.getLinkageConditionValue();
				this.getPlainItemValue();
			}, 10000);

			setInterval(() => {
				//检查是否过期
				this.getApplicationVaild();
			}, 10000);
			// (60000*5)
		},
		methods: {

			async sendDeviceControl(modelno, key) {
				uni.showToast({
					title: this.lanuage.IsDoing,
					//将值设置为 success 或者直接不用写icon这个参数
					icon: 'success',
					//显示持续时间为 2秒
					duration: 500
				})
				const ret = await this.$myRequest({
					url: "/api/product/p1015/Device/sendDeviceControl?pguid=" + uni.getStorageSync(
						'productGuid') + "&key=" + key + "&modelno=" + modelno,
					data: {
						// pguid: uni.getStorageSync('productGuid'),
						// key: key,
						// modelno: modelno
					}
				})
				if (ret.respCode == "200") {
					this.getDeviceCurentvalueToModel(modelno, "status", key); //显示按钮状态


					uni.showToast({
						title: this.lanuage.OperationSuccessful,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'success',
						//显示持续时间为 2秒
						duration: 1000
					})
					//console.log('sucess' + JSON.stringify(ret.data));

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}
			},
			async setLinkageStatus(modelno, status) {

				const ret = await this.$myRequest({
					url: "/api/product/p1015/LinkageCondition/setLinkageStatus?pguid=" + uni
						.getStorageSync('productGuid') + "&status=" + status + "&modelno=" + modelno,
					data: {}
				})
				if (ret.respCode == "200") {
					uni.showToast({
						title: this.lanuage.OperationSuccessful,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'success',
						//显示持续时间为 2秒
						duration: 2000
					})
					//	console.log('sucess' + JSON.stringify(ret.data));

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}

			},
			async getLinkageStatus() {
				const ret = await this.$myRequest({
					url: "/api/product/p1015/LinkageCondition/getLinkageLists?pguid=" + uni
						.getStorageSync('productGuid'),
					data: {}
				})
				if (ret.respCode == "200") {

					if (this.LinkageConditionValue == JSON.stringify(ret.data)) {
						return;
					}
					this.LinkageConditionValue = JSON.stringify(ret.data);

					ret.data.some((item, i) => {
						if (item.l_p_model_no == 12) {
							if (item.l_status == 0) {
								this.ecisCheck = true;
							} else {
								this.ecisCheck = false;
							}
						} else if (item.l_p_model_no == 13) {
							if (item.l_status == 0) {
								this.phisCheck = true;
							} else {
								this.phisCheck = false;
							}
						}
					})
					//console.log('sucess' + JSON.stringify(ret.data));

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}

			},

			async setLinkageConditionValue(modelno, value) {

				//console.log(this.wateringSecond + "------");
				const ret = await this.$myRequest({
					url: "/api/product/p1015/LinkageCondition/setLinkageConditionValue?pguid=" + uni
						.getStorageSync('productGuid') + "&val=" + value + "&modelno=" + modelno,
					data: {}
				})
				if (ret.respCode == "200") {
					this.getLinkageConditionValue();
					uni.showToast({
						title: this.lanuage.OperationSuccessful,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'success',
						//显示持续时间为 2秒
						duration: 2000
					})
					//	console.log('sucess' + JSON.stringify(ret.data));

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}

			},
			async getLinkageConditionValue() {
				//console.log(this.wateringSecond + "------");
				const ret = await this.$myRequest({
					url: "/api/product/p1015/LinkageCondition/getLinkageConditionValue?pguid=" + uni
						.getStorageSync('productGuid'),
					data: {}
				})
				if (ret.respCode == "200") {

					if (this.LinkageConditionValue == JSON.stringify(ret.data)) {
						return;
					}
					this.LinkageConditionValue = JSON.stringify(ret.data);



					ret.data.some((item, i) => {

						if (item.modelNo == 3) {
							this.wateringSecond = item.value;
						} else if (item.modelNo == 17) {
							this.lightlow = item.value;
						} else if (item.modelNo == 19) {
							this.lighthigh = item.value;
						} else if (item.modelNo == 21) {
							this.co2low = item.value;
						} else if (item.modelNo == 23) {
							this.co2high = item.value;
						} else if (item.modelNo == 5) {
							this.currentFlow1 = item.value;
						} else if (item.modelNo == 7) {
							this.currentFlow2 = item.value;
						} else if (item.modelNo == 9) {
							this.currentFlow3 = item.value;
						} else if (item.modelNo == 11) {
							this.currentFlow4 = item.value;
						} else if (item.modelNo == 13) {
							this.currentFlow5 = item.value;
						} else if (item.modelNo == 15) {
							this.currentFlow6 = item.value;
						} else if (item.modelNo == 25) {
							this.setEC = item.value;
						} else if (item.modelNo == 27) {
							this.setPH = item.value;
						} else if (item.modelNo == 81) {
							this.temperatureLowDown = item.value;
						} else if (item.modelNo == 83) {
							this.temperatureLowUp = item.value;
						} else if (item.modelNo == 114) {
							this.warnecDown = item.value;
						} else if (item.modelNo == 116) {
							this.warnecUp = item.value;
						} else if (item.modelNo == 121) {
							this.warnphDown = item.value;
						} else if (item.modelNo == 123) {
							this.warnphUp = item.value;
						} else if (item.modelNo == 128) {
							this.warnwatertempDown = item.value;
						} else if (item.modelNo == 130) {
							this.warnwatertempUp = item.value;
						} else if (item.modelNo == 145) {
							this.warnlightDown = item.value;
						} else if (item.modelNo == 148) {
							this.warnlightUp = item.value;
						} else if (item.modelNo == 155) {
							this.warntempDown = item.value;
						} else if (item.modelNo == 159) {
							this.warntempUp = item.value;
						} else if (item.modelNo == 165) {
							this.warnhumdown = item.value;
						} else if (item.modelNo == 168) {
							this.warnhumUp = item.value;
						} else if (item.modelNo == 176) {
							this.warnco2down = item.value;
						} else if (item.modelNo == 178) {
							this.warnco2Up = item.value;
						}
					})
					//console.log('sucess' + JSON.stringify(ret.data));

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}

			},
			async getPruductLanguage(languagecode) {
				uni.setStorageSync('languagecode', languagecode);
				const ret = await this.$myRequest({
					url: "/api/common/Language/getPruductLanguageAlone?pguid=" + uni.getStorageSync(
						'productGuid') + "&languagecode=" + languagecode,
					data: {
						//pguid: uni.getStorageSync('productGuid'),
					}
				})
				if (ret.respCode == "200") {
					var cCode = 0;
					var content = "";
					ret.data.some((item, i) => {
						cCode = item.code;
						content = item.content;
						if (cCode == 1000) {
							this.lanuage.open = content;
						} else if (cCode == 1001) {
							this.lanuage.close = content;
						} else if (cCode == 1005) {
							this.lanuage.save = content;
						} else if (cCode == 1006) {
							this.lanuage.pipeline = content;
						} else if (cCode == 1004) {
							this.lanuage.WaterPumpOn = content;
						} else if (cCode == 1003) {
							this.lanuage.WaterPumpOff = content;
						} else if (cCode == 1002) {
							this.lanuage.totalWater = content;
						} else if (cCode == 1008) {
							this.lanuage.startAutoMode = content;
						} else if (cCode == 1009) {
							this.lanuage.stopAutoMode = content;
						} else if (cCode == 1007) {
							this.lanuage.second = content;
						} else if (cCode == 1010) {
							this.lanuage.total = content;
						} else if (cCode == 1112) {
							this.lanuage.duration = content;
						} else if (cCode == 1012) {
							this.lanuage.workingState = content;
						} else if (cCode == 1024) {
							this.lanuage.Runing = content;
						} else if (cCode == 1013) {
							this.lanuage.GatewayOffline = content;
						} else if (cCode == 1014) {
							this.lanuage.minute = content;
						} else if (cCode == 1015) {
							this.lanuage.autoMode = content;
						} else if (cCode == 1016) {
							this.lanuage.manualMode = content;
						} else if (cCode == 1017) {
							this.lanuage.conditionMode = content;
						} else if (cCode == 1018) {
							this.lanuage.ValueLowerThan = content;
						} else if (cCode == 1019) {
							this.lanuage.LightLowerThan = content;
						} else if (cCode == 1020) {
							this.lanuage.Co2lowerThan = content;
						} else if (cCode == 1021) {
							this.lanuage.openLight = content;
						} else if (cCode == 1022) {
							this.lanuage.openCo2 = content;
						} else if (cCode == 1025) {
							this.lanuage.light = content;
						} else if (cCode == 1026) {
							this.lanuage.co2 = content;
						} else if (cCode == 1027) {
							this.lanuage.stoptime = content;
						} else if (cCode == 1028) {
							this.lanuage.runtime = content;
						} else if (cCode == 1029) {
							this.lanuage.lastruntime = content;
						} else if (cCode == 1031) {
							this.lanuage.Humidity = content;
						} else if (cCode == 1030) {
							this.lanuage.Temperature = content;
						} else if (cCode == 1033) {
							this.lanuage.AutoRunMode = content;
						} else if (cCode == 1032) {
							this.lanuage.ManualRunMode = content;
						} else if (cCode == 1035) {
							this.lanuage.OperationSuccessful = content;
						} else if (cCode == 1034) {
							this.lanuage.OperationFaild = content;
						} else if (cCode == 1036) {
							this.lanuage.IsDoing = content;
						} else if (cCode == 1037) {
							this.lanuage.NextRunTime = content;
						} else if (cCode == 1038) {
							this.lanuage.LightIntensity = content;
						} else if (cCode == 1039) {
							this.lanuage.motor = content;
						} else if (cCode == 1041) {
							this.lanuage.temperaturebelow = content;
						} else if (cCode == 1040) {
							this.lanuage.heating = content;
						} else if (cCode == 1042) {
							this.lanuage.agitatormotor = content;
						} else if (cCode == 1043) {
							this.lanuage.watertemp = content;
						} else if (cCode == 1044) {
							this.lanuage.airconditioner = content;
						} else if (cCode == 1045) {
							this.lanuage.heating = content;
						} else if (cCode == 1046) {
							this.lanuage.refrigeration = content;
						} else if (cCode == 1053) {
							this.lanuage.configuration = content;
						} else if (cCode == 1052) {
							this.lanuage.alarm = content;
						} else if (cCode == 1055) {
							this.lanuage.tsconfirm = content;
						} else if (cCode == 1056) {
							this.lanuage.tscancel = content;
						} else if (cCode == 1057) {
							this.lanuage.tscontent = content;
						} else if (cCode == 1061) {
							this.lanuage.pipeline1 = content;
						} else if (cCode == 1062) {
							this.lanuage.pipeline2 = content;
						} else if (cCode == 1060) {
							this.lanuage.pipeline3 = content;
						} else if (cCode == 1063) {
							this.lanuage.pipeline4 = content;
						} else if (cCode == 1083) {
							this.lanuage.Noise = content;
						} else if (cCode == 1082) {
							this.lanuage.Ozone = content;
						} else if (cCode == 1081) {
							this.lanuage.Formaldehyde = content;
						} else if (cCode == 1070) {
							this.lanuage.autoTasktitle = content;
						} else if (cCode == 1106) {
							this.lanuage.sb1title = content;
						} else if (cCode == 1111) {
							this.lanuage.sb2title = content;
						} else if (cCode == 1107) {
							this.lanuage.dg1title = content;
						} else if (cCode == 1108) {
							this.lanuage.dg2title = content;
						} else if (cCode == 1109) {
							this.lanuage.dg3title = content;
						} else if (cCode == 1110) {
							this.lanuage.faucet = content;
						} else if (cCode == 1077) {
							this.lanuage.normaltitle = content;
						}
					});

					//	console.log('sucess' + JSON.stringify(ret.data));

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}

				this.getProductWarn();
			},
			async setPlainItemValue(modelno, value) {

				if (modelno == 2 || modelno == 4) {
					value = (value * 60)
				}
				const ret = await this.$myRequest({
					url: "/api/product/p1015/PlainItem/setPlainItemValue?pguid=" + uni.getStorageSync(
						'productGuid') + "&val=" + value + "&modelno=" + modelno,
					data: {
						// pguid: uni.getStorageSync('productGuid'),
						// val: value,
						// modelno: modelno
					}
				})
				if (ret.respCode == "200") {
					this.getPlainItemValue(modelno);
					uni.showToast({
						title: this.lanuage.OperationSuccessful,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'success',
						//显示持续时间为 2秒
						duration: 2000
					})
					//console.log('sucess' + JSON.stringify(ret.data));

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}

			},
			async getPlainItemValue() {
				const ret = await this.$myRequest({
					url: "/api/product/p1015/PlainItem/getPlainItemValue?pguid=" + uni.getStorageSync(
						'productGuid'),
					data: {
						//pguid: uni.getStorageSync('productGuid'),
					}
				})
				if (ret.respCode == "200") {

					if (this.PlainItemValue == JSON.stringify(ret.data)) {
						return;
					}
					this.PlainItemValue = JSON.stringify(ret.data);



					ret.data.some((item, i) => {

						if (item.modelNo == 2) {
							this.startmin = item.value / 60;
						} else if (item.modelNo == 4) {
							this.stopMin = item.value / 60;
						}
					})
					//console.log('sucess' + JSON.stringify(ret.data));

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}

			},
			async getTimeInterval() {
				//if (this.autoRun == 1) {
				//	this.startTimeIntervalNextSecond = 0;
				//	return;
				//}

				//autoRun 1停止，0启动
				const ret = await this.$myRequest({
					url: "/api/product/p1015/Time/getTimeIntervalByPguid?pguid=" + uni.getStorageSync(
						'productGuid') + "&startmodelno=2&endmodelno=4",
					data: {
						// pguid: uni.getStorageSync('productGuid'),
						// startmodelno: 2,
						// endmodelno: 4
					}
				})
				if (ret.respCode == "200") {
					//debugger
					//ret.data.some((item, i) => {
					//if (item.ti_p_model_no == modelno) {
					this.startTimeInterval = "";
					if (ret.data.nextHowLongSecond == null && this.autoRun == 0) {
						this.startTimeInterval = this.lanuage.Runing;
						this.startTimeIntervalNextSecond = 0;
						//	console.log(this.lanuage.Runing);
						return;
					}


					//debugger;
					//this.startTimeInterval = ret.data.lastExecuteTime;
					if (this.autoRun == 0) {
						this.startTimeIntervalNextSecond = ret.data.nextHowLongSecond;
						if ((this.startTimeIntervalNextSecond / 60) > 1) {
							this.startTimeIntervalNextSecondstr = Math.round((this.startTimeIntervalNextSecond / 60))
								.toString() + this.lanuage.minute;
						} else {
							this.startTimeIntervalNextSecondstr = Math.round(this.startTimeIntervalNextSecond)
								.toString() +
								this.lanuage.second;
						}
					}
					//console.log('sucess' + JSON.stringify(ret.data));

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}
			},
			showtaskset() {
				uni.navigateTo({
					url: "taskset"
				})
			},


			getSecond() {

				if (this.autoRun == 1) {
					this.startTimeIntervalNextSecond = 0;
					return;
				}
				//倒计时
				this.startTimeIntervalNextSecond = this.startTimeIntervalNextSecond - 1;
				if ((this.startTimeIntervalNextSecond / 60) > 1) {
					this.startTimeIntervalNextSecondstr = Math.round((this.startTimeIntervalNextSecond / 60))
						.toString() + this.lanuage.minute;

				} else {
					this.startTimeIntervalNextSecondstr = Math.round(this.startTimeIntervalNextSecond).toString() + this
						.lanuage.second;
				}
			},
			async setValueCurrentByFlowClear(modelno) {

				var pagethis = this;
				//修改流量清理
				uni.showModal({
					//title: '提示',
					content: pagethis.lanuage.tscontent + "?",
					cancelText: pagethis.lanuage.tscancel, // 取消按钮的文字  
					confirmText: pagethis.lanuage.tsconfirm, // 确认按钮的文字  
					showCancel: true, // 是否显示取消按钮，默认为 true
					success: function(res) {
						if (res.confirm) {
							// 执行确认后的操作
							pagethis.setValueCurrentByProduct(modelno, 'totalPulse', '0');
							pagethis.setValueCurrentByProduct(modelno, 'totalFlow', '0');

						} else {
							// 执行取消后的操作
							return;
						}
					}
				})
			},
			async setValueCurrentByProduct(modelno, key, val) {



				const ret = await this.$myRequest({
					url: "/api/product/p1015/DeviceValueCurrent/setValueCurrentByProduct?pguid=" + uni
						.getStorageSync(
							'productGuid') + "&modelno=" + modelno + "&key=" + key + "&val=" + val,
					data: {
						//pguid: uni.getStorageSync('productGuid')
					}
				})
				if (ret.respCode == "200") {

					this.getValueCurrentByProduct();
					uni.showToast({
						title: this.lanuage.OperationSuccessful,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'success',
						//显示持续时间为 2秒
						duration: 2000
					})

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}

			},

			async getValueCurrentByProduct() {

				const ret = await this.$myRequest({
					url: "/api/product/p1015/DeviceValueCurrent/getValueCurrentByProduct?pguid=" + uni
						.getStorageSync('productGuid'),
					data: {
						//pguid: uni.getStorageSync('productGuid')
					}
				})
				//uni.stopPullDownRefresh(); // 停止当前页面刷新
				if (ret.respCode == "200") {


					if (this.ValueCurrentByProduct == JSON.stringify(ret.data)) {
						return;
					}
					this.ValueCurrentByProduct = JSON.stringify(ret.data);
					//	console.log('sucess' + JSON.stringify(ret.data));
					ret.data.some((item, i) => {
						this.getDeviceCurentvalueToModel(item.modelNo, item.key, item.value);
					})
					// this.banner = data.data;
				} else {
					console.log('fail' + JSON.stringify(ret.data));
				}


			},
			getDeviceCurentvalueToModel(dmodelNo, key, value) {


				if (dmodelNo == "3" && key == "temperature") {
					this.temperature = value;
				} else if (dmodelNo == "3" && key == "humidity") {
					this.humidity = value;
				} else if (dmodelNo == "3" && key == "co2") {
					this.co2 = value;
				} else if (dmodelNo == "3" && key == "light") {
					this.light = value;
				} else if (dmodelNo == "3" && key == "pm10") {
					this.pm10 = value;
				} else if (dmodelNo == "3" && key == "pm2.5") {
					this.pm25 = value;
				} else if (dmodelNo == "3" && key == "formaldehyde") {
					this.formaldehyde = value;
				} else if (dmodelNo == "3" && key == "tvoc") {
					this.tvoc = value;
				} else if (dmodelNo == "3" && key == "noise") {
					this.noise = value;
				} else if (dmodelNo == "3" && key == "ozone") {
					this.ozone = value;
				} else if (dmodelNo == "4" && key == "ec") {
					this.ec = value;
				} else if (dmodelNo == "5" && key == "ph") {
					this.ph = value;
				} else if (dmodelNo == "23" && key == "totalFlow") {
					this.totalFlow = parseFloat(value).toFixed(1);
				} else if (dmodelNo == "17" && key == "totalFlow") {
					this.total1Value = parseFloat(value).toFixed(1);
				} else if (dmodelNo == "18" && key == "totalFlow") {
					this.total2Value = parseFloat(value).toFixed(1);
				} else if (dmodelNo == "19" && key == "totalFlow") {
					this.total3Value = parseFloat(value).toFixed(1);
				} else if (dmodelNo == "20" && key == "totalFlow") {
					this.total4Value = parseFloat(value).toFixed(1);
				} else if (dmodelNo == "21" && key == "totalFlow") {
					this.total5Value = parseFloat(value).toFixed(1);
				} else if (dmodelNo == "22" && key == "totalFlow") {
					this.total6Value = parseFloat(value).toFixed(1);
				} else if (dmodelNo == "4" && key == "temperature") {
					this.watertempValue = parseFloat(value).toFixed(1);
				} else if (dmodelNo == "42" && key == "status") {
					if (value == "yes") {
						this.warnecisCheck = true;
					} else {
						this.warnecisCheck = false;
					}
				} else if (dmodelNo == "43" && key == "status") {
					if (value == "yes") {
						this.warnphisCheck = true;
					} else {
						this.warnphisCheck = false;
					}
				} else if (dmodelNo == "44" && key == "status") {
					if (value == "yes") {
						this.warnwatertempisCheck = true;
					} else {
						this.warnwatertempisCheck = false;
					}
				} else if (dmodelNo == "45" && key == "status") {
					if (value == "yes") {
						this.warnlightisCheck = true;
					} else {
						this.warnlightisCheck = false;
					}
				} else if (dmodelNo == "46" && key == "status") {
					if (value == "yes") {
						this.warntempisCheck = true;
					} else {
						this.warntempisCheck = false;
					}
				} else if (dmodelNo == "47" && key == "status") {
					if (value == "yes") {
						this.warnhumisCheck = true;
					} else {
						this.warnhumisCheck = false;
					}
				} else if (dmodelNo == "48" && key == "status") {
					if (value == "yes") {
						this.warnco2isCheck = true;
					} else {
						this.warnco2isCheck = false;
					}
				} else if (dmodelNo == "15") {
					this.sb1status = value;
				} else if (dmodelNo == "11") {
					this.sb2status = value;
				} else if (dmodelNo == "16") {
					this.jiaoshuiStatus = value;
				} else if (dmodelNo == "30") {
					this.chuangdongStatus = value;

				} else if (dmodelNo == "7") {
					this.dg1status = value;
				} else if (dmodelNo == "24") {
					this.eryanghuatanStatus = value;
				} else if (dmodelNo == "31") {
					this.jiaobangjiStatus = value;
				} else if (dmodelNo == "26") {
					this.yingyang1Status = value;
				} else if (dmodelNo == "8") {
					this.yingyang2Status = value;
				} else if (dmodelNo == "13") {
					this.yingyang3Status = value;
				}else if (dmodelNo == "12") {
					this.yingyang4Status = value;
				}	
				 else if (dmodelNo == "32") {
					this.kongtiaoStatus = value;
				} else if (dmodelNo == "53") {
					this.dg2status = value;
				} else if (dmodelNo == "54") {
					this.dg3status = value;
				}

			},
			async getProductGateWayIsOnlineByCache() {
				const ret = await this.$myRequest({
					url: "/api/product/p1015/DeviceLiveState/getProductGateWayIsOnlineByCache?pguid=" + uni
						.getStorageSync('productGuid'),
					data: {
						//pguid: uni.getStorageSync('productGuid')
					}
				})
				if (ret.errMsg != null) {
					//this.isNormalNetwork = false;
					//this.msg = "网络已断开 工作异常";
				} else {

					if (ret.respCode == "200") {

						if (ret.data == false) {

							this.workModemsg = this.lanuage.GatewayOffline;
						} else {

							this.workModemsg = this.lanuage.normaltitle; /// "正常";
						}
						//console.log('sucess' + JSON.stringify(ret.data));

						// this.banner = data.data;
					} else {
						console.log('fail' + JSON.stringify(ret.data));
					}


					if (this.isNormalNetwork == false) {
						location.reload();
						//刷新页面
						this.isNormalNetwork = true;
					}
				}

			},
			temperatureSave() {
				if (parseFloat(this.temperatureLowUp) <= parseFloat(this.temperatureLowDown)) {
					this.$nextTick(() => {
						this.temperatureLowUp = parseFloat(this.temperatureLowDown) + 1;
					});
					//	return;
				}

				this.setLinkageConditionValue(81, this.temperatureLowDown);
				this.setLinkageConditionValue(83, this.temperatureLowUp);
				this.setLinkageConditionValue(91, this.temperatureLowDown);
				this.setLinkageConditionValue(92, this.temperatureLowUp);
				//this.setValueCurrentByProduct(33, "status", "no", "关闭", "")
				this.sendDeviceControl(33, "no");
			},
			inputNumberChange(e) {
				//营养液			
				if (e.currentTarget.id == "currentFlow1") {
					if ((parseFloat(this.currentFlow1) * 1) <= 0) {
						this.$nextTick(() => {
							this.currentFlow1 = 0;
						});
					} else {
						this.$nextTick(() => {
							this.currentFlow1 = parseFloat(this.currentFlow1) * 1;
						});
					}
				}
				if (e.currentTarget.id == "currentFlow2") {
					if ((parseFloat(this.currentFlow2) * 1) <= 0) {
						this.$nextTick(() => {
							this.currentFlow2 = 0;
						});
					} else {
						this.$nextTick(() => {
							this.currentFlow2 = parseFloat(this.currentFlow2) * 1;
						});
					}
				}
				if (e.currentTarget.id == "currentFlow3") {
					if ((parseFloat(this.currentFlow3) * 1) <= 0) {
						this.$nextTick(() => {
							this.currentFlow3 = 0;
						});
					} else {
						this.$nextTick(() => {
							this.currentFlow3 = parseFloat(this.currentFlow3) * 1;
						});
					}
				}
				//启动时长
				if (e.currentTarget.id == "stopMin") {
					if ((parseFloat(this.stopMin) * 1) <= 0) {
						this.$nextTick(() => {
							this.stopMin = 0;
						});
					} else {
						this.$nextTick(() => {
							this.stopMin = parseInt(this.stopMin) * 1;
						});
					}
				}
				if (e.currentTarget.id == "startmin") {
					if ((parseFloat(this.startmin) * 1) <= 0) {
						this.$nextTick(() => {
							this.startmin = 0;
						});
					} else {
						this.$nextTick(() => {
							this.startmin = parseInt(this.startmin) * 1;
						});
					}
				}
				//浇水时长
				if (e.currentTarget.id == "wateringSecond") {

					if ((parseFloat(this.wateringSecond) * 1) <= 0) {
						this.$nextTick(() => {
							this.wateringSecond = 0;
						});
					} else {
						this.$nextTick(() => {
							this.wateringSecond = parseInt(this.wateringSecond) * 1;
						});
					}
				}
				//条件设置
				if (e.currentTarget.id == "setEC") {
					if ((parseFloat(this.setEC) * 1) <= 0) {
						this.$nextTick(() => {
							this.setEC = 0;
						});
					} else {
						this.$nextTick(() => {
							this.setEC = parseFloat(this.setEC) * 1;
						});
					}
				}

				if (e.currentTarget.id == "setPH") {

					if ((parseFloat(this.setPH) * 1) <= 0) {
						this.$nextTick(() => {
							this.setPH = 0;
						});
					} else {
						this.$nextTick(() => {
							this.setPH = parseFloat(this.setPH) * 1;
						});
					}
				}

				if (e.currentTarget.id == "co2low") {

					if ((parseFloat(this.co2low) * 1) <= 0) {
						this.$nextTick(() => {
							this.co2low = 0;
						});
					} else {
						this.$nextTick(() => {
							this.co2low = parseFloat(this.co2low) * 1;
						});
					}

				}

				if (e.currentTarget.id == "lightlow") {
					if ((parseFloat(this.lightlow) * 1) <= 0) {
						this.$nextTick(() => {
							this.lightlow = 0;
						});
					} else {
						this.$nextTick(() => {
							this.lightlow = parseFloat(this.lightlow) * 1;
						});
					}
				}

				if (e.currentTarget.id == "temperatureLowDown") {
					if ((parseFloat(this.temperatureLowDown) * 1) <= 0) {
						this.$nextTick(() => {
							this.temperatureLowDown = 0;
						});
					} else {
						this.$nextTick(() => {
							this.temperatureLowDown = parseFloat(this.temperatureLowDown) * 1;
						});
					}
				}
				if (e.currentTarget.id == "temperatureLowUp") {
					if ((parseFloat(this.temperatureLowUp) * 1) <= 0) {
						this.$nextTick(() => {
							this.temperatureLowUp = 0;
						});
					} else {
						this.$nextTick(() => {
							this.temperatureLowUp = parseFloat(this.temperatureLowUp) * 1;
						});
					}


				}

			},
			sendHeat() {
				this.sendDeviceControl(32, 'open');
				setTimeout(() => {
					this.sendDeviceControl(32, 'hot');
				}, 2000);

			},
			sendCold() {
				this.sendDeviceControl(32, 'open');
				setTimeout(() => {
					this.sendDeviceControl(32, 'cold');
				}, 2000);

			},
			sendAirconditionClose() {
				this.sendDeviceControl(32, 'close');
				this.sendDeviceControl(33, 'no');
			},
			async getProductWarn() {
				const ret = await this.$myRequest({
					url: "/api/product/p1015/Warn/getProductWarn?pguid=" + uni.getStorageSync(
						'productGuid') + "&languagecode=" + uni.getStorageSync('languagecode'),
					data: {
						//pguid: uni.getStorageSync('productGuid'),
					}
				})
				//debugger
				if (ret.respCode == "200") {
					this.warnmsg = ret.data;
					//console.log('sucess' + JSON.stringify(ret.data));

				} else {
					uni.showToast({
						title: this.lanuage.OperationFaild,
						//将值设置为 success 或者直接不用写icon这个参数
						icon: 'none',
						//显示持续时间为 2秒
						duration: 2000
					})
					console.log('fail' + JSON.stringify(ret.data));
				}
			},
			async getApplicationVaild() {

				//检查是否过期
				const ret = await this.$myRequest({
					url: "/api/common/Application/getApplicationVaild",
					data: {}
				})

				if (ret.respCode == "200") {
					//	console.log('sucess' + JSON.stringify(ret.data));

				} else if (ret.respCode == "500") {
					uni.navigateTo({
						url: "appExpire"
					})
					console.log('fail' + JSON.stringify(ret.data));
				}

			},
			showWarnModal() {
				uni.navigateTo({
					url: "warnset"
				})
			},
			async sendDeviceControlDefault(modelno, key) {
				//加载页面时模拟请求
				const ret = await this.$myRequest({
					url: "/api/product/p1015/Device/sendDeviceControl?pguid=" + uni.getStorageSync(
						'productGuid') + "&key=" + key + "&modelno=" + modelno,
					data: {}
				})
			},

			switchecChange() {
				if (this.ecisCheck == true) {
					this.ecisCheck = false;
				} else {
					this.ecisCheck = true;
				}
			},
			switchphChange() {
				if (this.phisCheck == true) {
					this.phisCheck = false;
				} else {
					this.phisCheck = true;
				}
			},
			switchlightChange() {
				if (this.lightisCheck == true) {
					this.lightisCheck = false;
				} else {
					this.lightisCheck = true;
				}
			},
			switchco2Change() {
				if (this.co2isCheck == true) {
					this.co2isCheck = false;
				} else {
					this.co2isCheck = true;
				}
			},
			showlinkageset() {
				uni.navigateTo({
					url: "linkageset"
				})
			},
		},

		onLoad(options) {
			//删除缓存


			uni.setStorageSync('productGuid', "8ac95d8a-c480-41c4-9ef7-3f2d8f8225b9");
			this.getValueCurrentByProduct();
			this.getLinkageConditionValue();
			this.getPlainItemValue();
			this.getProductGateWayIsOnlineByCache();
			this.getTimeInterval();

			var languagecode = uni.getStorageSync('languagecode');
			if (languagecode == null || languagecode == "") {
				this.getPruductLanguage(100);
			} else {
				this.getPruductLanguage(languagecode);
			}
			this.getProductWarn();
			this.sendDeviceControlDefault(5, 'collect');
		}
	}
</script>

<style lang="scss">
	.viewshuifeitop {

		line-height: 20px;
		min-height: 50px;
		padding-top: 10px;
		padding-left: 5px;
		padding-right: 5px;
		background-color: #77c72a;
		border-radius: 5px;
		color: #fff;
		text-align: center;
		float: left;
		margin-left: 8px;
		margin-top: 10px;

	}

	.viewshuifeitopImg {
		float: left;
		margin-right: 5px;
		padding-top: 10px;
	}

	.tablewater1 td {
		padding: 10px;
		min-width: 50px;
	}

	.tabfloortitle {
		line-height: 30px;
		margin: 10px;
		background-color: #69f053;
		border-radius: 20px;
		padding-left: 20px;
		font-size: 14px;

	}

	.dengclass {
		width: 48px;
		height: 48px;

	}

	.dengbutimg {
		width: 60px;
		height: 60px;
	}

	.dengtable {
		margin-left: 10px;
	}

	.dengtable td {
		padding: 3px;
		text-align: center;

	}

	.dengview {
		background-color: #fff;
		width: 230px;
		border-radius: 5px;
		margin-top: 10px;
		margin-left: 10px;
		padding: 1px;
	}

	.container {
		position: absolute;
		width: 100%;
		height: 100%;
		//background-color:darkblue;
		//background-color: #f3f1f1;
		//background-color: #28c32b;
		background-image: url("../../static/image_gooli/goolimainbg.png");
		background-size: 100% 100%;
		font-family: '微软雅黑';

	}

	.tableListset td {
		text-align: center;
		line-height: 40px;
	}

	.butsetshoudong {
		line-height: 40px;
		font-size: 14px;
		//background-color: #8373fb;
		background-color: #316c00;
		padding-left: 5px;
		padding-right: 5px;
		color: #fff;
		min-width: 70px;

	}

	.tablewater td {}


	.tableList td {
		line-height: 50px;
	}

	.tableList input {
		margin: 0px auto;
		background-color: #b0e2a3;
		width: 70px;
		height: 35px;
		text-align: center;

	}



	.tableListset input {
		margin: 0px auto;
		background-color: #b0e2a3;
		width: 60px;
		height: 30px;
		text-align: center;
	}

	.tableListset button {
		width: 80px;
		line-height: 35px;
		width: 65px;
	}

	.butset2 {
		line-height: 40px;
		font-size: 16px;

	}

	.butset3 {
		line-height: 40px;
		font-size: 16px;
		//background-color: #8373fb;
		background-color: #316c00;
		padding: 0px;
		color: #fff;
		min-width: 60px;
	}

	.jiaoshuiclass td {
		padding-right: 10px;
	}

	.tablemanual td {
		text-align: center;
		line-height: 45px;
		font-size: 14px;
	}
</style>